package com.theydream.qeechain.loading;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;

import com.papaya.social.PPYSNSRegion;
import com.papaya.social.PPYSocial;
import com.theydream.qeechain.R;

/**
 * Loading TheyDream Logo
 *
 */
public class IntroTextStartingScreen extends Activity{
	private TextView mText;
	private Animation text_Animation;
	private Animation text_Animation_2;
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.introtext_starting_screen);
//		//initialize Papaya Social SDK.
//		initializePapay();
		mText=(TextView) findViewById(R.id.intro_text);
		mText.setText(R.string.intro_text_1);
		text_Animation = AnimationUtils.loadAnimation(this, R.anim.introtext_starting_screen);
		mText.startAnimation(text_Animation);
		text_Animation_2 = AnimationUtils.loadAnimation(this, R.anim.introtext_starting_screen);
		
		text_Animation.setAnimationListener(new Animation.AnimationListener() {
			public void onAnimationEnd(Animation animation) {
						mText.startAnimation(text_Animation_2);
			}

			public void onAnimationRepeat(Animation animation) {
			}

			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub
			}
	});
		
		text_Animation_2.setAnimationListener(new Animation.AnimationListener() {
			public void onAnimationEnd(Animation animation) {
				
					Intent intent=new Intent(IntroTextStartingScreen.this,StartingScreen2R.class);
					//intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
					startActivity(intent);
					IntroTextStartingScreen.this.finish();
			}

			public void onAnimationRepeat(Animation animation) {
			}

			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub
				mText.setText(getString(R.string.intro_text_2));
			}
	});
	}
	
	public void initializePapay()
	{
		/**
		 * initialize Papaya Social SDK.
		 */
		PPYSocial.initWithConfig(this, new PPYSocial.Config() {
			public String getApiKey() {
				return "54SO2c8ZwFLINBtn";
			}

			@Override
			public String getChinaApiKey() {
				return "R7YDrbFtBFnZD1BG";
			}

			public PPYSNSRegion getSNSRegion() {
				return PPYSNSRegion.GLOBAL;
			}

			public String getPreferredLanguage() {
				return PPYSocial.LANG_AUTO; //set the preferred language
			}

			public String getAndroidMapsAPIKey() {
			  
				//The Android Maps API Key, please signup for your own at http://code.google.com/android/maps-api-signup.html.
				return "0t2EQqb8aNOyev7eAmrF2dRGGzjGRZl0Hno2hNg"; //key for demo only  
			}

			/*@Override
			public int timeToShowRegistration() {
				return 2;
			}

			@Override
			public int getBillingChannels() {
				return BillingChannel.ZONG | BillingChannel.PAYPAL | BillingChannel.AMAZON | BillingChannel.ALIPAY;
			}

			@Override
			public boolean isLeaderboardVisible() {
				return false;
			}
			
			@Override
			public boolean isSkipEnabledInRegistration() {
				return false; //disable skip link in registration
			}			
			*/
//			@Override
//			public int getBillingChannels() {
//				return BillingChannel.ALL;
//			}


		});

	}
	
	

}
